package com.chenwut.test1;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int m = scanner.nextInt();

        boolean[] isStillIn = new boolean[n];

        for(int i=0;i<n;i++){
            isStillIn[i]=true;
        }

        int count = n;
        int num = 0;
        int index = k-1;
        while (count>1){
            if (isStillIn[index]){
                num++;
                if (num==m){
                    num=0;
                    isStillIn[index]=false;
                    count--;
                }
            }
            index++;
            if (index==n){
                index=0;
            }
        }
        for (int i = 0; i < n; i++) {
            if (isStillIn[i]){
                System.out.println(i+1);
            }
        }
    }

}